#ifndef _TFT_272_480_H_
#define _TFT_272_480_H_

#define LCD_HARDWARE_WIDTH  480
#define LCD_HARDWARE_HEIGHT 272

#define LCD_WIDTH  272
#define LCD_HEIGHT 480

#ifndef BYTE_HEIGHT
  #define BYTE_HEIGHT 24
#endif
#ifndef BYTE_WIDTH
  #define BYTE_WIDTH  (BYTE_HEIGHT / 2)
#endif

#ifndef LARGE_BYTE_HEIGHT
  #define LARGE_BYTE_HEIGHT 32
#endif
#ifndef LARGE_BYTE_WIDTH
  #define LARGE_BYTE_WIDTH  18
#endif

#define ICON_WIDTH   95
#define ICON_HEIGHT  80
#define TITLE_END_Y  25                 // title height
#define ICON_START_Y (TITLE_END_Y + 4)  // top margin

#define LIST_ICON_WIDTH  85
#define LIST_ICON_HEIGHT 60

#define INFOBOX_WIDTH    215
#define INFOBOX_HEIGHT   80

#define SMALLICON_WIDTH  65
#define SMALLICON_HEIGHT 55

// Status Screen menu
#define SS_ICON_COUNT            2
#define SS_ICON_WIDTH            ICON_WIDTH
#define SS_ICON_HEIGHT           ICON_HEIGHT
#define SS_ICON_NAME_Y0          5
#define SS_ICON_VAL_Y0           62
#define STATUS_MSG_ICON_XOFFSET  5
#define STATUS_MSG_ICON_YOFFSET  3
#define STATUS_MSG_TITLE_XOFFSET 5
#define STATUS_MSG_BODY_XOFFSET  0
#define STATUS_MSG_BODY_YOFFSET  44
#define STATUS_MSG_BODY_BOTTOM   6
#define STATUS_GANTRY_YOFFSET    4

#define SS_ICON_TITLE_FONT_SIZE FONT_SIZE_NORMAL
#define SS_ICON_VAL_FONT_SIZE   FONT_SIZE_NORMAL

// Preheat menu
#define PREHEAT_TITLE_Y 0
#define PREHEAT_TOOL_Y  35
#define PREHEAT_BED_Y   65

// Printing menu
#define PS_ICON_LG_WIDTH  154
#define PS_ICON_SM_WIDTH  121
#define PS_ICON_HEIGHT    48
#define PS_ICON_SPACE_X   (LCD_WIDTH - PS_ICON_LG_WIDTH * 2 - SPACE_X)
#define PS_ICON_SPACE_Y   ((ICON_HEIGHT + SPACE_Y - PS_ICON_HEIGHT * 2) / 4)
#define PS_ICON_START_Y   (TITLE_END_Y + 4 + (ICON_HEIGHT + SPACE_Y - PS_ICON_HEIGHT * 2 - PS_ICON_SPACE_Y * 2))
#define PS_ICON_TITLE_X   52
#define PS_ICON_TITLE_Y   0
#define PS_ICON_VAL_X     PS_ICON_TITLE_X
#define PS_ICON_VAL_Y     (PS_ICON_HEIGHT / 2)
#define PS_ICON_VAL_LG_EX 150
#define PS_ICON_VAL_SM_EX 117

// Popup menu
#define POPUP_RECT_WINDOW         {SPACE_X * 2, TITLE_END_Y, LCD_WIDTH - SPACE_X * 2, LCD_HEIGHT - SPACE_Y / 2}
#define POPUP_TITLE_HEIGHT        35
#define POPUP_BOTTOM_HEIGHT       50
#define POPUP_BUTTON_HEIGHT       35
#define POPUP_BUTTON_WIDTH        ((LCD_WIDTH - SPACE_X * 7) / 2)
#define POPUP_RECT_SINGLE_CONFIRM {LCD_WIDTH / 2 - POPUP_BUTTON_WIDTH / 2, LCD_HEIGHT - SPACE_Y - 5 - POPUP_BUTTON_HEIGHT, LCD_WIDTH / 2 + POPUP_BUTTON_WIDTH / 2, LCD_HEIGHT - SPACE_Y - 5}
#define POPUP_RECT_DOUBLE_CONFIRM {SPACE_X * 3, LCD_HEIGHT - SPACE_Y - 5 - POPUP_BUTTON_HEIGHT, SPACE_X * 3 + POPUP_BUTTON_WIDTH, LCD_HEIGHT - SPACE_Y - 5}
#define POPUP_RECT_DOUBLE_CANCEL  {SPACE_X * 4 + POPUP_BUTTON_WIDTH * 1, LCD_HEIGHT - SPACE_Y - 5 - POPUP_BUTTON_HEIGHT, SPACE_X * 4 + POPUP_BUTTON_WIDTH * 2, LCD_HEIGHT - SPACE_Y - 5}

// The offset of the model preview icon in the gcode file
#define MODEL_PREVIEW_OFFSET 0x4D6E

#endif
